package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.jsola.hr.dto.EmpNoticeAddDTO;
import org.jsola.hr.dto.EmpNoticeUpdateDTO;
import org.jsola.hr.query.EmpNoticeQuery;
import org.jsola.hr.vo.EmpNoticeListVO;
import org.jsola.hr.vo.EmpNoticeVO;

import java.util.List;

/**
 * 员工通知
 *
 * @author zhr
 */
@Api(tags = "hr-员工通知")
public interface IEmpNoticeControllerAPI {

    /**
     * 新增员工通知
     *
     * @param empNoticeAddDTO 员工通知新增实体
     * @return 员工通知展示对象
     */
    @ApiOperation(value = "新增员工通知")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empNoticeAddDTO", dataType = "EmpNoticeAddDTO", value = "新增员工通知", paramType = "body")
    })
    Result<EmpNoticeVO> save(EmpNoticeAddDTO empNoticeAddDTO);


    /**
     * 修改员工通知
     *
     * @param empNoticeUpdateDTO 员工通知
     * @return 更新数量
     */
    @ApiOperation(value = "修改员工通知")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empNoticeUpdateDTO", dataType = "EmpNoticeUpdateDTO", value = "修改员工通知", paramType = "body")
    })
    Result<Integer> update(EmpNoticeUpdateDTO empNoticeUpdateDTO);


    /**
     * 删除单个员工通知，彻底删除
     *
     * @param empNoticeId 员工通知id
     * @return 删除数量
     */
    @ApiOperation(value = "删除单个员工通知，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empNoticeId", dataType = "String", value = "员工通知id", paramType = "path")
    })
    Result<Integer> delete(String empNoticeId);


    /**
     * 批量删除员工通知，彻底删除
     *
     * @param empNoticeIds 员工通知id集合
     * @return 删除数量
     */
    @ApiOperation(value = "批量删除员工通知，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empNoticeIds", dataType = "String[]", value = "员工通知id数组", paramType = "body", allowMultiple = true)
    })
    Result<Integer> deleteBatch(String[] empNoticeIds);


    /**
     * 根据员工通知id查询员工通知详情
     *
     * @param empNoticeId 员工通知id
     * @return 员工通知详情
     */
    @ApiOperation(value = "根据员工通知id查询员工通知详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empNoticeId", dataType = "String", value = "员工通知id", paramType = "path")
    })
    Result<EmpNoticeVO> findById(String empNoticeId);


    /**
     * 查询员工通知
     *
     * @param empNoticeQuery 员工通知查询参数
     * @return page
     */
    @ApiOperation(value = "查询员工通知")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empNoticeQuery", dataType = "EmpNoticeQuery", value = "员工通知查询参数", paramType = "query")
    })
    Result<List<EmpNoticeListVO>> listAll(EmpNoticeQuery empNoticeQuery);


    /**
     * 分页查询员工通知
     *
     * @param empNoticeQuery 员工通知查询参数
     * @return page
     */
    @ApiOperation(value = "分页查询员工通知")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empNoticeQuery", dataType = "EmpNoticeQuery", value = "员工通知查询参数", paramType = "query")
    })
    Result<Page<EmpNoticeListVO>> page(EmpNoticeQuery empNoticeQuery);


    /**
     * 查询员工通知
     *
     * @param empNoticeQuery 员工通知查询参数
     * @return page
     */
    @ApiOperation(value = "查询用户通知,根据用户分组,每个用户只展示最新一条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "公司id", paramType = "path"),
            @ApiImplicitParam(name = "empNoticeQuery", dataType = "EmpNoticeQuery", value = "通知查询参数", paramType = "query")
    })
    Result<List<EmpNoticeListVO>> listUserNoticeGroupByUser(String companyId, EmpNoticeQuery empNoticeQuery);


    /**
     * 分页查询员工通知
     *
     * @param empNoticeQuery 员工通知查询参数
     * @return page
     */
    @ApiOperation(value = "分页查询用户通知,根据用户分组,每个用户只展示最新一条")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "公司id", paramType = "path"),
            @ApiImplicitParam(name = "empNoticeQuery", dataType = "EmpNoticeQuery", value = "通知查询参数", paramType = "query")
    })
    Result<Page<EmpNoticeListVO>> pageUserNoticeGroupByUser(String companyId, EmpNoticeQuery empNoticeQuery);

    /**
     * 查询员工通知
     *
     * @param empNoticeQuery 员工通知查询参数
     * @return page
     */
    @ApiOperation(value = "查询用户通知,给某个人发送的所有通知")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "公司id", paramType = "path"),
            @ApiImplicitParam(name = "empNoticeQuery", dataType = "EmpNoticeQuery", value = "通知查询参数", paramType = "query")
    })
    Result<List<EmpNoticeListVO>> listNoticeByUser(String companyId, EmpNoticeQuery empNoticeQuery);


    /**
     * 分页查询员工通知
     *
     * @param empNoticeQuery 员工通知查询参数
     * @return page
     */
    @ApiOperation(value = "分页查询用户通知,给某个人发送的所有通知")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "公司id", paramType = "path"),
            @ApiImplicitParam(name = "empNoticeQuery", dataType = "EmpNoticeQuery", value = "通知查询参数", paramType = "query")
    })
    Result<Page<EmpNoticeListVO>> pageNoticeByUser(String companyId, EmpNoticeQuery empNoticeQuery);


    /**
     * 查询员工通知
     *
     * @param empNoticeQuery 员工通知查询参数
     * @return page
     */
    @ApiOperation(value = "查询用户通知,当前登录用户的所有通知")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "公司id", paramType = "path"),
            @ApiImplicitParam(name = "empNoticeQuery", dataType = "EmpNoticeQuery", value = "通知查询参数", paramType = "query")
    })
    Result<List<EmpNoticeListVO>> listNoticeCurrentUser(String companyId, EmpNoticeQuery empNoticeQuery);


    /**
     * 分页查询员工通知
     *
     * @param empNoticeQuery 员工通知查询参数
     * @return page
     */
    @ApiOperation(value = "分页查询用户通知,当前登录用户的所有通知")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "公司id", paramType = "path"),
            @ApiImplicitParam(name = "empNoticeQuery", dataType = "EmpNoticeQuery", value = "通知查询参数", paramType = "query")
    })
    Result<Page<EmpNoticeListVO>> pageNoticeCurrentUser(String companyId, EmpNoticeQuery empNoticeQuery);


    /**
     * 查看用户通知的详情
     *
     * @param userNoticeId 用户接收的通知id
     * @return 查看用户通知的详情
     */
    @ApiOperation(value = "查看用户通知的详情(通知接收者)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userNoticeId", dataType = "String", value = "用户接收的通知id", paramType = "path")
    })
    Result<EmpNoticeListVO> findUserNotice(String userNoticeId);

    /**
     * 删除单个用户接收的通知，彻底删除
     *
     * @param userNoticeId 用户接收的通知id
     * @return 删除数量
     */
    @ApiOperation(value = "删除单个用户接收的通知，彻底删除(通知接收者)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userNoticeId", dataType = "String", value = "用户接收的通知id", paramType = "path")
    })
    Result<String> deleteUserNotice(String userNoticeId);


    /**
     * 批量删除用户接收的通知，彻底删除
     *
     * @param userNoticeIds 用户接收的通知id集合
     * @return 删除数量
     */
    @ApiOperation(value = "批量删除用户接收的通知，彻底删除(通知接收者)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userNoticeIds", dataType = "String[]", value = "用户接收的通知id数组", paramType = "body", allowMultiple = true)
    })
    Result<String> deleteUserNoticeBatch(String[] userNoticeIds);

    /**
     * 将用户通知置为已读
     *
     * @param userNoticeId 用户接收的通知id
     * @param empId        员工id
     * @return 已读数量
     */
    @ApiOperation(value = "将用户通知置为已读(通知接收者)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userNoticeId", dataType = "String", value = "用户接收的通知id", paramType = "path"),
            @ApiImplicitParam(name = "empId", dataType = "String", value = "员工id", paramType = "query")
    })
    Result<String> readUserNotice(String userNoticeId, String empId);


    /**
     * 批量将用户通知置为已读
     *
     * @param userNoticeId 用户接收的通知id
     * @param empIds       员工id数组
     * @return 已读数量
     */
    @ApiOperation(value = "批量将用户通知置为已读(通知接收者)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userNoticeId", dataType = "String", value = "用户接收的通知id", paramType = "path"),
            @ApiImplicitParam(name = "empIds", dataType = "String[]", value = "员工id数组", paramType = "body", allowMultiple = true)
    })
    Result<String> readUserNoticeBatch(String userNoticeId, String[] empIds);

}

